package com.lanou.service.Impl;

import com.lanou.entity.Certificate;
import com.lanou.mapper.CertificateMapper;
import com.lanou.service.CertificateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName CertificateServiceImpl
 * @Description TODO
 * @Author chenzhaobao
 * @Date 2025年08月14日 9:53
 * @Version 1.0
 */
@Service
public class CertificateServiceImpl implements CertificateService {
    @Autowired
    private CertificateMapper certificateMapper;
    @Override
    public int insertCertificate(Certificate certificate) {
        return certificateMapper.insert(certificate);
    }

    @Override
    public int deleteCertificateById(Integer id) {
        return certificateMapper.deleteById(id);
    }

    @Override
    public int updateCertificate(Certificate certificate) {
        return certificateMapper.updateById(certificate);
    }

    @Override
    public Certificate getCertificateById(Integer id) {
        return certificateMapper.selectById(id);
    }

    @Override
    public List<Certificate> getAllCertificates() {
        return certificateMapper.selectAll();
    }

    @Override
    public List<Certificate> getCertificatesByConsultantId(Integer consultantId) {
        return certificateMapper.selectByConsultantId(consultantId);
    }
}
